<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<link href="template/css/Site_inscription.css" type="text/css" rel="stylesheet"/>
		<title>Site_accueil</title>
	</head>
	
	<body>
		<?php
			include('header.html');
		?>
		<section id="content">
			<article>
				<span>Informations :</span><br/><br/>
				<?php
					while($bien = $biens->fetch_object()) {
				?>
					<img src="photos/<?php echo $bien->url; ?>" style="float:left;margin-right:10px;height:150px;width:150px;" alt="photo"/>
					Type : <?php echo $bien->libelle; ?><br/>
					Surface : <?php echo $bien->surface; ?> m²<br/>
					Tarif journ&eacute;e : <?php echo $bien->prix_journee; ?> €<br/>
					Tarif semaine : <?php echo $bien->prix_semaine; ?> €<br/>
					Adresse : <?php echo $bien->adresse; ?><br/>
					<?php echo $bien->zip_code; ?> <?php echo $bien->ville; ?><br/>
					<?php echo $bien->pays; ?><br/>
					Description : <?php echo nl2br($bien->description); ?><br/>
				<?php
					}
				?><br/><br/>
				<span>Dates de disponibilit&eacute; :</span><br/><br/>
				<?php
					while($dispo = $dispos->fetch_object()) {
				?>
					- Du <?php echo $dispo->debut_dispo; ?> au <?php echo $dispo->fin_dispo; ?><br/>
				<?php
					}
				?><br/><br/>
				<span>Locations en cours ou &agrave; venir :</span><br/><br/>
				<?php
					while($location = $locations->fetch_object()) {
				?>
					- <?php echo $location->prenom; ?> <?php echo $location->nom; ?> du <?php echo $location->debut_location; ?> au <?php echo $location->fin_location; ?><br/> 
				<?php
					}
				?><br/><br/>
			</article>
			<?php
				while($avi = $avis->fetch_object()) {
			?>
			<article class="commentaire">
				<span><?php echo $avi->prenom; ?> <?php echo $avi->nom; ?> : <?php echo $avi->note; ?>/10</span><br/>
				<p><?php echo $avi->avis; ?></p>
			</article><br/>
			<?php
				}
			?>
			<?php
				if(($query1 == 0) && ($query2 >= 1)) {
			?>
			<form action="posterAvis.php" method="POST">
				<input type="hidden" name="bien" value="<?php echo $_GET['id']; ?>" />
				Note :<select name="note">
					<?php
						for($i=0;$i<=10; $i++) {
					?>
					<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php
						}
					?>
				</select><br/>
				Avis : <textarea name="avis"></textarea><br/>
				<input type="submit" value="Poster mon avis" />
			</form>
			<?php
				}
			?>
		</section><br/>
		<?php
			include('footer.html');
		?>
	</body>
</html>